﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using ObjectLibrary;
// -----------------------------------------------------------------------
// <copyright file="$safeitemrootname$.cs" company="$registeredorganization$">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace _0912089_0912172
{
    public class My3DVideo : MyVideo
    {
        public My3DVideo(ContentManager content, string videoName, float scale, Vector3 pos, float rotationY)
        {
            videoPlayer = new VideoPlayer();
            video = content.Load<Video>(videoName);
            _model = new PlanarModel(content, "", scale, pos, rotationY);
        }

        public override void Update(GameTime gameTime)
        {
            if (videoPlayer.State == MediaState.Playing)
            {
                ((PlanarModel)_model).Texture = videoPlayer.GetTexture();
            }
        }

        public override void Draw(GameTime gameTime, GraphicsDevice graphicsDevice, Effect effect, MyCamera camera)
        {
            base.Draw(gameTime, graphicsDevice, effect, camera);
        }
    }
}
